Skip to content

Remove advanced templating option#1277

Merged
cpinn merged 50 commits intocaitlin/externalizefrom
caitlin/remove-templating-optino
Jan 29, 2026
Merged

Remove advanced templating option#1277
cpinn merged 50 commits intocaitlin/externalizefrom
caitlin/remove-templating-optino

Conversation

@cpinn
Copy link
Contributor

@cpinn cpinn commented Jan 16, 2026

Nunjucks templating is known to not work in cloudflare environments due to a restriction on eval() capability.

In order to isolate the templating dependency and provide a new cloudflare package, this change will remove nunjucks as a templating option from the base sdk.

Users who would like to use the advanced templating will need to install a separate @braintrust/template-nunjucks package that will register the templating option for use as a plugin.

Adds an integration test with the main braintrust build that runs the two packages together and updates a few of our other integration tests to run the full test suite.

@cpinn cpinn changed the title Caitlin/remove templating optino Remove templating option Jan 16, 2026
@cpinn cpinn force-pushed the caitlin/externalize branch from b716030 to 8d2e5e2 Compare January 16, 2026 05:15
@cpinn cpinn closed this Jan 21, 2026
CLowbrow and others added 2 commits January 21, 2026 11:38
Co-authored-by: Alex Z <alex.zelenskiy@braintrustdata.com>
Co-authored-by: Ankur Goyal <ankrgyl@gmail.com>
Co-authored-by: Caitlin Pinn <caitlin.pinn@gmail.com>
Co-authored-by: Alex Z <alex.zelenskiy@braintrustdata.com>
@cpinn cpinn reopened this Jan 22, 2026
@cpinn cpinn force-pushed the caitlin/remove-templating-optino branch from ad84951 to 143beac Compare January 22, 2026 21:28
@cpinn cpinn changed the title Remove templating option Remove advanced templating option Jan 22, 2026
@cpinn cpinn force-pushed the caitlin/remove-templating-optino branch from 064e527 to 30d6de3 Compare January 24, 2026 05:09
@cpinn
Copy link
Contributor Author

cpinn commented Jan 26, 2026

@ibolmo I modified the registration back to one registration call for the default.

I moved the integration tests for otel-js and templates-nunjucks into their respective folders for auto-discovery. (currently /scenarios but I have a change to make it consistent with /smoke/scenarios and anything in /integrations/smoke/scenarios would be picked up as integration tests)

I am still having an issue with the deno test properly picking up the changes from the local tarball seems to be a problem with links I am looking into, when I use npm it is attempting to grab the existing 2.x braintrust and not the local package I am expecting. Other than that it should be good to review. The other existing failures are from the async local storage missing in brower builds.

@cpinn cpinn force-pushed the caitlin/remove-templating-optino branch from 9a0045d to 4db121d Compare January 26, 2026 22:40
"imports": {
"@std/assert": "jsr:@std/assert@^1.0.14",
"@braintrust/smoke-test-shared": "jsr:@braintrust/smoke-test-shared",
"@braintrust/templates-nunjucks-js": "../../../dist/index.mjs",
Copy link
Contributor Author

@cpinn cpinn Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patching local packages only works if the package is on npm which this package is not yet. This has proved difficult to work around other than pointing to the file and installing the missing packages.

https://deno.com/blog/v2.3#local-npm-packages

@cpinn cpinn force-pushed the caitlin/remove-templating-optino branch from c1097e3 to e37d662 Compare January 27, 2026 00:17
@cpinn cpinn force-pushed the caitlin/remove-templating-optino branch from 45faed1 to 4545c79 Compare January 27, 2026 00:53
cpinn added 4 commits January 26, 2026 17:26
…1307)

## New braintrust/browser package

This changset adds a new package, `braintrust/browser`, which introduces
the browser-compatible AsyncLocalStorage als-browser package.

## Use the new package

`pnpm add @braintrust/browser braintrust`

Users can export anything they would usually export from braintrust from
braintrust/browser.

## Using the older braintrust build

Users that install `braintrust` will now receive a message if they are
attempting to use the build in a browser environment. This will inform
them to install the new `braintrust/browser` package for improved
compatibility.

Importing directly from braintrust in a browser environment will
continue to work. The new exports for edge-light, workerd, and browser
exports will point to isomorph builds with no-op or deprecated behavior.
@cpinn cpinn force-pushed the caitlin/remove-templating-optino branch 2 times, most recently from 1185598 to 4da4b25 Compare January 29, 2026 22:12
@cpinn cpinn merged commit e722771 into caitlin/externalize Jan 29, 2026
68 checks passed
@cpinn cpinn deleted the caitlin/remove-templating-optino branch January 29, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants